<template>
    <bi-form-item :label="item.title" >
        <bi-input v-model="value" v-if="item.type=='text'"  ></bi-input>
        <bi-select v-model="value" :option="item.options" v-if="item.type=='select'"></bi-select>
    </bi-form-item>
</template>

<script>
import fieldMixin from  '@@/admin/assets/bi-plug/fieldMixin.js';
export default{
    mixins:[fieldMixin],
    props:{
        item:Object
    },
    computed:{
        value:{
            get(){
                return this.modelValue;
            },
            set(val){
                this.$emit('update:modelValue',val);
                //this.$emit('change',val,this.valueLabel);
                this.valueChange(val);
            }
        },
    },
    mounted(){
        
        if (this.item.defaultValue){
            this.value = this.item.defaultValue;
        }

        console.log(this.item.defaultValue);
    }
}
</script>